//tab
function scrollDoor(){
}
scrollDoor.prototype = {
	sd : function(menus,divs,openClass,closeClass,t){
		var _this = this;
		if(menus.length != divs.length)
		{
			alert("!");
			return false;
		}				
		for(var i = 0 ; i < menus.length ; i++)
		{	
			_this.$(menus[i]).value = i;				
			_this.$(menus[i]).onclick = function(){
		
				for(var j = 0 ; j < menus.length ; j++)
				{			
					if(menus[j] != menus[this.value] && divs[j] != divs[this.value])
					{	
						_this.$(menus[j]).className = closeClass;
						_this.$(divs[j]).style.display = "none";
					}
				}
				_this.$(menus[this.value]).className = openClass;	
				
				if(document.getElementById('viewStat_'+t).value == 'grid')
				{
					_this.$(divs[this.value]).style.display = "block";				
				}
			}
		}
	},
	$ : function(oid){
		if(typeof(oid) == "string")
		return document.getElementById(oid);
		return oid;
	}
}
window.onload = function(){
	var SDmodel = new scrollDoor();
	SDmodel.sd(["d01","d02"],["dd01","dd02"],"sd01","sd02", '1');
	SDmodel.sd(["m01","m02","m03","m04","m05"],["dm01","dm02","dm03","dm04","dm05"],"sd01","sd02", '2');
	
}

//下拉菜单
var menuids=["connection","throughput"] //Enter id(s) of SuckerTree UL menus, separated by commas

/*
function buildsubmenus(){
for (var i=0; i<menuids.length; i++){
	alert(menuids[i]);
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
    ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.display="block"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.display="none"
    }
    }
  }
}
*/

/*
if (window.addEventListener)
//window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
//window.attachEvent("onload", buildsubmenus)
*/